import java.sql.*;
import java.io.*;

class JdbcDemo22 {

	public static void main(String[] args) throws Exception {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
		PreparedStatement ps = cn.prepareStatement("insert into mem_reg values(?,?,?,?)");
		ps.setString(1, "naresh");
		ps.setString(2, "nit");
		ps.setString(3, "nit123");
		File f = new File("Penguins.jpg");
		FileInputStream fis = new FileInputStream(f);
		ps.setBinaryStream(4, fis, fis.available());
		int count = ps.executeUpdate();
		System.out.println(count);
		ps.close();
		cn.close();
		
		// TODO Auto-generated method stub

	}

}
